home *** CD-ROM | disk | FTP | other *** search
- package com.supercede.forms;
-
- import java.applet.Applet;
- import java.awt.AWTEvent;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dialog;
- import java.awt.Frame;
- import java.awt.Graphics;
- import java.awt.Point;
- import java.awt.event.WindowEvent;
- import java.io.IOException;
- import java.io.InvalidObjectException;
- import java.io.ObjectInputStream;
- import java.io.Serializable;
- import java.util.Vector;
-
- public class SuperCedeDialog extends Dialog implements SuperCedeDesignContainer, Serializable {
- SuperCedeRuntimeInfo runtimeInfo;
- SuperCedeDesignInfo designInfo;
- transient boolean designMode;
- transient DesignModeListener formListener;
- transient Vector scContainerListeners;
- boolean shadowEnabled;
- boolean shadowModal;
- Point shadowLocation;
- private static final long serialVersionUID = 1013082004010516611L;
- private static final int _version = 1;
- private int version;
-
- public SuperCedeDialog() {
- this(new Frame());
- }
-
- public SuperCedeDialog(Frame var1) {
- super(var1);
- this.version = 1;
- this.runtimeInfo = new SuperCedeRuntimeInfo();
- this.designInfo = new SuperCedeDesignInfo();
- this.designMode = false;
- this.formListener = null;
- this.scContainerListeners = null;
- this.shadowEnabled = super.isEnabled();
- this.shadowModal = super.isModal();
- this.shadowLocation = new Point(0, 0);
- }
-
- public final void initializeThis(Vector var1) throws IOException, ClassNotFoundException, ClassCastException, SuperCedeInvalidStateException {
- this.designInfo = null;
- this.runtimeInfo = null;
- SuperCedeHelper.runTimeConstructor(this, var1);
- this.setModal(this.shadowModal);
- ((Component)this).setLocation(this.shadowLocation);
- ((Component)this).enableEvents(64L);
- this.validateObject();
- }
-
- public Component[] getContainedComponents() {
- return ((Container)this).getComponents();
- }
-
- public void initializeFrom(SuperCedeContainer var1) throws ClassCastException, SuperCedeInvalidStateException {
- try {
- this.setDesignMode(((SuperCedeDesignContainer)var1).isDesignMode());
- this.setFormListener(((SuperCedeDesignContainer)var1).getFormListener());
- this.runtimeInfo = var1.getRuntimeInfo();
- this.designInfo = ((SuperCedeDesignContainer)var1).getDesignInfo();
- SuperCedeHelper.convertContainer((Container)var1, this);
- if (!this.isDesignMode()) {
- this.runtimeInfo = null;
- this.designInfo = null;
- }
- } catch (ClassCastException var3) {
- throw var3;
- }
- }
-
- public SuperCedeDesignInfo getDesignInfo() {
- return this.designInfo;
- }
-
- public SuperCedeRuntimeInfo getRuntimeInfo() {
- return this.runtimeInfo;
- }
-
- public void addComponent(Component var1, Object var2) {
- this.addComponent(var1, var2, -1);
- }
-
- public void addComponent(Component var1, Object var2, int var3) {
- this.add(var1, var2, var3);
- this.runtimeInfo.addLayoutConstraints(var1, var2);
- }
-
- public void add(Component var1, Object var2, int var3) {
- super.add(var1, var2, var3);
- if (((Component)this).isVisible() && var1 instanceof Applet) {
- ((Applet)var1).start();
- }
-
- }
-
- public void removeComponent(int var1) {
- this.removeComponent(((Container)this).getComponent(var1));
- }
-
- public void removeComponent(Component var1) {
- this.runtimeInfo.removeLayoutConstraints(var1);
- this.remove(var1);
- }
-
- public void remove(Component var1) {
- if (((Component)this).isVisible() && var1 instanceof Applet) {
- ((Applet)var1).stop();
- }
-
- super.remove(var1);
- }
-
- public boolean isEnabled() {
- return this.shadowEnabled;
- }
-
- public void setEnabled(boolean var1) {
- this.shadowEnabled = var1;
- if (!this.isDesignMode()) {
- super.setEnabled(var1);
- }
-
- }
-
- public void paint(Graphics var1) {
- if (this.formListener != null) {
- this.formListener.paint(var1);
- }
-
- super.paint(var1);
- }
-
- public void addNotify() {
- super.addNotify();
- if (this.formListener != null) {
- this.formListener.addedPeer();
- }
-
- }
-
- public void removeNotify() {
- if (this.formListener != null) {
- this.formListener.removingPeer();
- }
-
- super.removeNotify();
- }
-
- public boolean isModal() {
- return this.isDesignMode() ? this.shadowModal : super.isModal();
- }
-
- public void setModal(boolean var1) {
- this.shadowModal = var1;
- if (!this.isDesignMode()) {
- super.setModal(var1);
- }
-
- }
-
- public Object getLayoutConstraints(Component var1) {
- return this.runtimeInfo.getLayoutConstraints(var1);
- }
-
- public Object getLayoutConstraints(int var1) {
- return this.getLayoutConstraints(((Container)this).getComponent(var1));
- }
-
- public void setDesignMode(boolean var1) {
- this.designMode = var1;
- }
-
- public boolean isDesignMode() {
- return this.designMode;
- }
-
- public void setFormListener(DesignModeListener var1) {
- this.formListener = var1;
- }
-
- public DesignModeListener getFormListener() {
- return this.formListener;
- }
-
- public void setVisible(boolean var1) {
- if (!var1) {
- SuperCedeHelper.setAppletVisibility(this, this.isDesignMode(), false);
- }
-
- boolean var2 = this.isDesignMode();
- this.setDesignMode(false);
- super.setVisible(var1);
- this.setDesignMode(var2);
- if (var1) {
- SuperCedeHelper.setAppletVisibility(this, this.isDesignMode(), true);
- }
-
- }
-
- protected void processWindowEvent(WindowEvent var1) {
- if (((AWTEvent)var1).getID() == 201 && this.scContainerListeners != null) {
- SuperCedeContainerEvent var3 = new SuperCedeContainerEvent(this, 4434);
- synchronized(this){}
-
- Vector var2;
- try {
- var2 = (Vector)this.scContainerListeners.clone();
- } catch (Throwable var6) {
- throw var6;
- }
-
- for(int var4 = 0; var4 < var2.size(); ++var4) {
- ((SuperCedeContainerListener)var2.elementAt(var4)).containerShutdown(var3);
- }
- }
-
- super.processWindowEvent(var1);
- }
-
- public void addSuperCedeContainerListener(SuperCedeContainerListener var1) {
- synchronized(this){}
-
- try {
- if (this.scContainerListeners == null) {
- this.scContainerListeners = new Vector();
- }
-
- this.scContainerListeners.addElement(var1);
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- public void removeSuperCedeContainerListener(SuperCedeContainerListener var1) {
- synchronized(this){}
-
- try {
- this.scContainerListeners.removeElement(var1);
- } catch (Throwable var4) {
- throw var4;
- }
-
- }
-
- private void readObject(ObjectInputStream var1) throws IOException, ClassNotFoundException {
- var1.defaultReadObject();
-
- try {
- SuperCedeHelper.doDeserializationProcessing(this);
- } catch (SuperCedeInvalidStateException var2) {
- }
- }
-
- public void validateObject() throws InvalidObjectException {
- }
- }
-